package com.crawler.console;

import java.io.IOException;
import java.net.MalformedURLException;

import com.crawler.base.CrawlerBase;

public class crawl {

	CrawlerBase crawlerBase;
	OutputWindow outWnd;
	public crawl()
	{
		outWnd = new OutputWindow();
		crawlerBase = new CrawlerBase(outWnd);
	}
	
	public void PrintHeader()
	{
		outWnd.PrintHeader();
	}
	
	public void PrintManual()
	{
		outWnd.PrinManual();
	}
	
	public void Init()
	{
		crawlerBase.Init();
	}
	
	public void SetSeedURL(String strSeedURL) throws IOException
	{
		crawlerBase.SetSeedURL(strSeedURL);
		crawlerBase.InitConnection();
	}
	
	public static void main(String args[])
	{
		crawl crawler = new crawl();
		crawler.PrintHeader();
		crawler.Init();
		crawler.PrintManual();
		
		try {
			crawler.SetSeedURL("http://news.sohu.com");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
